<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_wallet', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->default(0)->comment('用户ID');
            $table->decimal('money',10,2)->default(0.00)->unsigned()->comment('账户余额（元）');
            $table->decimal('gift_balance',10,2)->default(0.00)->unsigned()->comment('赠送余额（元）');
            $table->decimal('score',10,2)->default(0.00)->unsigned()->comment('积分');
        });
        DB::statement("ALTER TABLE `user_wallet` comment '【用户】钱包'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_wallet');
    }
};
